package com.laivi.basic.type.orm;


/**
 * @author laivi.zhu@gmail.com
 * @date 2014-7-8
 * description:
 */
public enum CndType {

	EQ("="), LE("<="), GE(">="), LT("<"), GT(">"),NOT("!="),DESC("desc"), ASC("asc");
	private final String text;

	CndType(String text) {
		this.text = text;
	}

	public String toText() {
		return text;
	}

	public static CndType fromValue(String text) {
		for (CndType type : values()) {
			if (type.toText().endsWith(text)) {
				return type;
			}
		}
		return CndType.EQ;
	}
}
